package org.nViron.nvConfig;

//~--- non-JDK imports --------------------------------------------------------

import org.nViron.nvCommon.nvPosition;
import org.nViron.nvParams.nvParamConfig;

/**
 * Basic configuration class of simulator
 * @author Roland Haring <p>
 * <script type="text/javascript" src="http://www.ohloh.net/p/376434/widgets/project_basic_stats.js"></script>
 */
public abstract class nvConfig implements nvParamConfig {
    private nvPosition userPosition   = new nvPosition();
    private nvPosition lookAtPosition = new nvPosition();
    private nvPosition cameraPosition = new nvPosition();
    private float      farP;
    private float      fov;
    private float      nearP;

    public nvConfig() {
        setDefaults();
    }

    public nvPosition getCameraPos() {
        return cameraPosition;
    }

    public nvPosition getCameraPosition() {
        return cameraPosition;
    }

    public float getFarP() {
        return farP;
    }

    public float getFOV() {
        return fov;
    }

    public nvPosition getLookAtPos() {
        return lookAtPosition;
    }

    public nvPosition getLookAtPosition() {
        return lookAtPosition;
    }

    public float getNearP() {
        return nearP;
    }

    public nvPosition getUserPos() {
        return userPosition;
    }

    public nvPosition getUserPosition() {
        return userPosition;
    }

    public abstract void loadConfig(String ressource);

    public abstract void saveConfig(String ressource);

    public void setCameraPos(nvPosition cameraPos) {
        this.cameraPosition = cameraPos;
    }

    public void setCameraPosition(nvPosition cameraPosition) {
        this.cameraPosition = cameraPosition;
    }

    protected void setDefaults() {
        userPosition.set(14.32, 48.3335, 0);
        cameraPosition.set(14.32, 48.3335, 1001.0f);
        lookAtPosition.set(14.32, 48.338, 10.0f);
        //lookAtPosition.set(14.32, 48.34, 251.0f);
        nearP = 1.0f;
        farP  = 2500.0f;
        fov   = 45.0f;
    }

    public void setFarP(float farP) {
        this.farP = farP;
    }

    public void setFOV(float fov) {
        this.fov = fov;
    }

    public void setLookAtPos(nvPosition lookAtPos) {
        this.lookAtPosition = lookAtPos;
    }

    public void setLookAtPosition(nvPosition lookAtPosition) {
        this.lookAtPosition = lookAtPosition;
    }

    public void setNearP(float nearP) {
        this.nearP = nearP;
    }

    public void setUserPos(nvPosition userPos) {
        this.userPosition = userPos;
    }

    public void setUserPosition(nvPosition userPosition) {
        this.userPosition = userPosition;
    }
}



